USE [influenza]
GO

/****** Object:  StoredProcedure [dbo].[SP_muestraCoMorbilidadPaciente]    Script Date: 01/14/2010 18:09:19 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[SP_muestraCoMorbilidadPaciente]
@param varchar(100)
as
Begin
declare @qry VARCHAR(8000)

SET @qry='select b.diagnostico from aux_Diagnosticos a 
			left join cat_diagnosticos b on (a.id_diagnostico = b.id_diagnostico ) 
			where a.id_registro ='+@param+' and id_decision = 1 and b.nTipo=3'

exec (@qry)

End
GO

